<template>
  <el-scrollbar>
    <el-table :data="tableData" style="width: 100%" size="large">
      <el-table-column label="用户ID" prop="id" sortable />
      <el-table-column label="用户头像" sortable>
        <template #default="scope"><img :src="scope.row.avatarUrl" alt="" /></template>
      </el-table-column>
      <el-table-column label="用户昵称" prop="nickName" />
      <el-table-column label="用户性别" sortable>
        <template #default="scope">{{ scope.row.gender ? '女' : '男' }}</template>
      </el-table-column>
      <el-table-column label="openId" prop="openId" show-overflow-tooltip />
      <el-table-column label="创建时间" prop="updateTime" sortable />
    </el-table>
    <el-table-column align="right">
      <template #header>
        <el-input v-model="search" size="default" placeholder="Type to search" />
      </template>
    </el-table-column>
  </el-scrollbar>
</template>

<script lang="ts" setup>
import axios from '@/utils/request'
import 'animate.css'
import { onMounted, ref } from 'vue'
let tableData = ref([])
const search = ''

const init = () => {
  axios.get('/user').then((res: Response) => {
    tableData.value = res.data
  })
}
onMounted(() => {
  init()
})
</script>
<style lang="less" scoped>
img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 4px;
}

.next {
  height: 80px;
  display: flex;
  justify-content: flex-end;
}
</style>
